package ui.swing.mechanics;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JRootPane;

public class CenterPositionDemo {
	public static void main(String[] args) {
		//JFrame.setDefaultLookAndFeelDecorated(true);
		final JFrame jf = new JFrame();
		jf.setSize(100, 200);
		
		jf.setUndecorated(true);
		jf.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
		Dimension d = jf.getToolkit().getScreenSize();
		jf.setLocation(d.width/2 - jf.getWidth()/2, d.height/2 - jf.getHeight()/2);
		
		JButton btn = new JButton("postOneKeyEvent!");
		jf.getContentPane().add(btn);

		jf.setVisible(true);
		
	}
}
